﻿/*======================================
作者：洞庭夕照
创建：2017.8.22
网站：www.ninesky.cn
      mzwhj.cnblogs.com
代码：git.oschina.net/ninesky/Ninesky
版本：v1.0.0.0
======================================*/
using Ninesky.Models;
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace Ninesky.IService
{
    /// <summary>
    /// 内容服务接口
    /// </summary>
    public interface IContentService:IBaseService<Content>
    {
        /// <summary>
        /// 查询实体分页数据
        /// </summary>
        /// <param name="predicate">查询条件</param>
        /// <param name="keySelector">排序字段属性表达式</param>
        /// <param name="isAsc">是否正序</param>
        /// <param name="paging">分页数据</param>
        /// <returns>分页数据</returns>
        Task<Paging<ContentItem>> FindPagingAsync<TKey>(Expression<Func<Content, bool>> predicate, Expression<Func<Content, TKey>> keySelector, bool isAsc, Paging<ContentItem> paging);

        /// <summary>
        /// 查询内容分页数据
        /// </summary>
        /// <param name="categoryId">栏目ID</param>
        /// <param name="type">内容类型</param>
        /// <param name="title">标题</param>
        /// <param name="inputer">录入者</param>
        /// <param name="status">状态</param>
        /// <param name="order">排序</param>
        /// <param name="paging">分页</param>
        /// <returns></returns>
        Task<Paging<ContentItem>> FindPagingAsync(int categoryId, ModuleType type, string title, string inputer, ContentStatus? status, ContentOrder? order, Paging<ContentItem> paging);
    }
}
